import request from '/@/utils/request';

/**
 * 
 * @param params 获取用户列表
 * @returns 
 */
export const getList = (params: any) => {
    return request({ url: '/api/system/user/read/page', params })
}

/**
 * 修改用户锁定状态
 * @param params 
 * @returns 
 */
export const changeUserLocked = (params: any) => {
    return request({ url: '/api/system/user/changeUserLocked', params, method: 'put'})
}

/**
 * 重置用户密码
 * @param params 
 * @returns 
 */
export const resetUserPassWord = (params: any) => {
    return request({ url: '/api/system/user/resetUserPassWord', params, method: 'put'})
}

/**
 * 添加用户
 * @param params 
 * @returns 
 */
export const addUser = (params: any) => {
    return request({ url: '/api/system/user', method: 'post', data: params})
}

export const editPassword = (params:any) => {
    return request({ url: '/api/system/user/updatePassword', method: 'put', data: params})
}

/**
 * 批量添加用户
 * @param params 
 * @returns 
 */
 export const batchAddUser = (params: any) => {
    return request({ url: '/api/system/user/batchAdd', method: 'post', data: params, headers: {'Content-Type': 'multipart/form-data;charset=utf-8'}})
}

/**
 * 修改用户
 * @param params 
 * @returns 
 */
 export const editUser = (params: any) => {
    return request({ url: '/api/system/user', method: 'put', data: params})
}

/**
 * 删除用户
 * @param params 
 * @returns 
 */
 export const deleteUser = (params: any) => {
    return request({ url: '/api/system/user', method: 'delete', data: params})
}

/**
 * 新增角色
 * @param params 
 * @returns 
 */
 export const allot = (params: any) => {
    return request({ url: '/api/system/auth/allot', method: 'post', data: params})
}